local convar = CreateClientConVar("EnergyE2s",0)
local function e2hook(ent)
        if ent and ent:IsValid() then
                if ent:GetClass() == "sent_anim" and convar:GetBool() then
                        if ent.Execute then
                                RD_Register(ent,true)
                                ent.override_ops = 1
                                ent.oldExecute = ent.Execute or function() end
                                ent.Execute = function(self)
                                        if self:GetResourceAmount("energy") >= self.override_ops then
                                            self:ConsumeResource("energy", self.override_ops)
											//ent.override_ops = (math.log(self.context.prfbench)+1)*2
											self.oldExecute(self)//execute
										else
											if self.error then return end
											self:Error("Ran out of Energy.")
                                        end
                                end
                        end
                end
        end
end
hook.Add("OnEntityCreated", "E2OVERRIDES", e2hook)